
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Git提速 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="markdown-doc.html" />
    
    
    <link rel="prev" href="gitbook-to-github.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../">
            
                <a href="../">
            
                    
                    编辑器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../editortools/SublineText3-Quick-Key.html">
            
                <a href="../editortools/SublineText3-Quick-Key.html">
            
                    
                    SublineText3快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../editortools/SublineText3.html">
            
                <a href="../editortools/SublineText3.html">
            
                    
                    SublineText3问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../editortools/iTerm2-guide.html">
            
                <a href="../editortools/iTerm2-guide.html">
            
                    
                    iTerm2指南
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../">
            
                <a href="../">
            
                    
                    乱七八糟
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="git-note.html">
            
                <a href="git-note.html">
            
                    
                    Git 简单笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="gitbook-doc.html">
            
                <a href="gitbook-doc.html">
            
                    
                    gitbook 教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="gitbook-to-github.html">
            
                <a href="gitbook-to-github.html">
            
                    
                    gitbook 集成到Github
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.4" data-path="git-integrate.html">
            
                <a href="git-integrate.html">
            
                    
                    Git提速
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="markdown-doc.html">
            
                <a href="markdown-doc.html">
            
                    
                    markdown 语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="maven-nexus.html">
            
                <a href="maven-nexus.html">
            
                    
                    Maven 私服搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="idea-config.html">
            
                <a href="idea-config.html">
            
                    
                    IDEA 配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="idea-quick-key.html">
            
                <a href="idea-quick-key.html">
            
                    
                    IDEA 快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="iterm2.html">
            
                <a href="iterm2.html">
            
                    
                    iTerm2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" >
            
                <a target="_blank" href="http://fontawesome.dashgame.com/">
            
                    
                    Font Awesome字体
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../">
            
                <a href="../">
            
                    
                    mariadb
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../mariadb/mariadb-install.html">
            
                <a href="../mariadb/mariadb-install.html">
            
                    
                    mariadb 安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../mariadb/mysql-install.html">
            
                <a href="../mariadb/mysql-install.html">
            
                    
                    mysql 安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../mariadb/mysql-base.html">
            
                <a href="../mariadb/mysql-base.html">
            
                    
                    mysql 基础知识
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../">
            
                <a href="../">
            
                    
                    MongoDB
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../mongodb/mongodb-install.html">
            
                <a href="../mongodb/mongodb-install.html">
            
                    
                    MongoDB 安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../">
            
                <a href="../">
            
                    
                    nginx
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../nginx/nginx-install.html">
            
                <a href="../nginx/nginx-install.html">
            
                    
                    Nginx 安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../nginx/nginx-commandline.html">
            
                <a href="../nginx/nginx-commandline.html">
            
                    
                    Ngixn 命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../nginx/nginx-virtualhost.html">
            
                <a href="../nginx/nginx-virtualhost.html">
            
                    
                    Nginx 虚拟主机
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../">
            
                <a href="../">
            
                    
                    HttpClient
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../httpclient/httpclient-timeout.html">
            
                <a href="../httpclient/httpclient-timeout.html">
            
                    
                    HttpClient几个超时
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../httpclient/httpclient-pool.html">
            
                <a href="../httpclient/httpclient-pool.html">
            
                    
                    HttpClient 连接池
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../">
            
                <a href="../">
            
                    
                    Java
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../java/001-tomcat-loader-cpu-high.html">
            
                <a href="../java/001-tomcat-loader-cpu-high.html">
            
                    
                    01-Tomcat应用负载过高—CPU过高
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../">
            
                <a href="../">
            
                    
                    Spring与SpringBoot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../SpringBoot/001-SpringBoot-form-jar-to-war.html">
            
                <a href="../SpringBoot/001-SpringBoot-form-jar-to-war.html">
            
                    
                    01-SpringBoot-Jar包转war包
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../">
            
                <a href="../">
            
                    
                    RPC
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../rpc/thrift/thrift-01-intro.html">
            
                <a href="../rpc/thrift/thrift-01-intro.html">
            
                    
                    01-Thrift简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../rpc/thrift/thrift-02-install.html">
            
                <a href="../rpc/thrift/thrift-02-install.html">
            
                    
                    02-Thrift安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../rpc/thrift/thrift-03-types.html">
            
                <a href="../rpc/thrift/thrift-03-types.html">
            
                    
                    03-Thrift数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../rpc/thrift/thrift-04-generated-code.html">
            
                <a href="../rpc/thrift/thrift-04-generated-code.html">
            
                    
                    04-Thrift代码生成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../rpc/thrift/thrift-05-architecture.html">
            
                <a href="../rpc/thrift/thrift-05-architecture.html">
            
                    
                    05-Thrift架构设计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../">
            
                <a href="../">
            
                    
                    线程世界
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../thread/01-traditional-thread.html">
            
                <a href="../thread/01-traditional-thread.html">
            
                    
                    01-传统线程技术
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../thread/02-traditional-mutex.html">
            
                <a href="../thread/02-traditional-mutex.html">
            
                    
                    02-线程之间的互斥
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../thread/03-traditional-communication.html">
            
                <a href="../thread/03-traditional-communication.html">
            
                    
                    03-线程之间的通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../thread/04-traditional-thread-state.html">
            
                <a href="../thread/04-traditional-thread-state.html">
            
                    
                    04-线程状态
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../thread/05-traditional-thread-join.html">
            
                <a href="../thread/05-traditional-thread-join.html">
            
                    
                    05-线程join方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../">
            
                <a href="../">
            
                    
                    Linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../linux/001-linux-command.html">
            
                <a href="../linux/001-linux-command.html">
            
                    
                    01-Linux常用命令总结
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../linux/002-linux-firewall.html">
            
                <a href="../linux/002-linux-firewall.html">
            
                    
                    02-Linux防火墙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="../linux/003-linux-tmux.html">
            
                <a href="../linux/003-linux-tmux.html">
            
                    
                    03-Linux-Tmux
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../">
            
                <a href="../">
            
                    
                    数据结构与算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../datastructure/01-intro.html">
            
                <a href="../datastructure/01-intro.html">
            
                    
                    01-简介
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../">
            
                <a href="../">
            
                    
                    前端
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../front/01-yarn.html">
            
                <a href="../front/01-yarn.html">
            
                    
                    01-yarn
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../front/02-jsx.html">
            
                <a href="../front/02-jsx.html">
            
                    
                    02-jsx语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../front/03-react-component.html">
            
                <a href="../front/03-react-component.html">
            
                    
                    03-React组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="../front/04-ES6.html">
            
                <a href="../front/04-ES6.html">
            
                    
                    04-ES6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.5" data-path="../front/05-webpack.html">
            
                <a href="../front/05-webpack.html">
            
                    
                    05-webpack
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Git提速</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="git-&#x6574;&#x5408;&#x63D0;&#x901F;">Git &#x6574;&#x5408;&#x63D0;&#x901F;</h1>
<p>&#x5148;&#x4E0A;&#x56FE;&#xFF1A;
<img src="images/git_environment.png" alt="Git Environment"></p>
<h2 id="1-&#x6545;&#x4E8B;&#x7531;&#x6765;">1. &#x6545;&#x4E8B;&#x7531;&#x6765;</h2>
<p>&#x60C5;&#x51B5;&#x662F;&#x8FD9;&#x6837;&#x7684;&#xFF0C;&#x5728;&#x56FD;&#x5185;&#x8BBF;&#x95EE; Github &#x8D8A;&#x6765;&#x8D8A;&#x6162;&#x4E86;&#xFF0C;&#x6709;&#x65F6;&#x66F4;&#x65B0;&#x6216;&#x8005;&#x63D0;&#x4EA4;&#x4EE3;&#x7801;&#x8FD8;&#x4F1A;&#x5931;&#x8D25;&#xFF0C;&#x5373;&#x4F7F;&#x4E0D;&#x5931;&#x8D25;&#xFF0C;&#x4E5F;&#x603B;&#x6709;&#x4E00;&#x6BB5;&#x7B49;&#x5F85;
&#x65F6;&#x95F4;&#xFF0C;&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x901F;&#x5EA6;&#x95EE;&#x9898;&#xFF0C;&#x51B3;&#x5B9A;&#x91C7;&#x7528;&#x56FD;&#x5185;&#x7684;&#x4EE3;&#x7801;&#x4ED3;&#x5E93;&#xFF0C;&#x5982;&#x7801;&#x4E91;&#xFF0C;coding &#x7B49;&#x3002;</p>
<p>&#x5728;&#x901F;&#x5EA6;&#x4E0A;&#x7801;&#x4E91;&#x548C; coding &#x90FD;&#x80FD;&#x6EE1;&#x8DB3;&#xFF0C;&#x4F46;&#x662F;&#x5747;&#x6709;&#x5176;&#x5C40;&#x9650;&#x6027;&#xFF0C;&#x7801;&#x4E91;&#x4E0D;&#x652F;&#x6301;&#x81EA;&#x5B9A;&#x4E49;&#x57DF;&#x540D;&#x7ED1;&#x5B9A;, coding &#x6CA1;&#x6709; github &#x6709;&#x540D;
&#xFF0C;&#x6BD5;&#x7ADF; github &#x624D;&#x662F;&#x6700;&#x5927;&#x7684;&#x7A0B;&#x5E8F;&#x5458;&#x4EA4;&#x6D41;&#x793E;&#x533A;&#xFF0C;&#x6240;&#x4EE5;&#x4E0D;&#x80FD;&#x653E;&#x5F03; github&#x3002;&#x4E3A;&#x4E86;&#x6EE1;&#x8DB3;&#x5982;&#x4E0A;&#x6761;&#x4EF6;&#xFF0C;&#x60F3;&#x7684;&#x65B9;&#x6848;&#x662F;&#x5148;&#x63D0;&#x4EA4;&#x7801;&#x4E91;
&#x7136;&#x540E;&#x518D;&#x5F02;&#x6B65;&#x63D0;&#x4EA4; github &#xFF0C;&#x8FD9;&#x6837;&#x65E2;&#x4FDD;&#x8BC1;&#x901F;&#x5EA6;&#xFF0C;&#x53C8;&#x80FD;&#x89E3;&#x51B3;&#x57DF;&#x540D;&#x4E0D;&#x7528;&#x5907;&#x6848;&#x7684;&#x95EE;&#x9898;&#x3002;</p>
<p>&#x7EA0;&#x7ED3;&#x7684;&#x4E8B;&#x60C5;&#x4E0D;&#x8BF4;&#x4E86;&#xFF0C;&#x76F4;&#x63A5;&#x8BF4;&#x7ED3;&#x679C;&#x5427;&#x3002;</p>
<p>&#x6839;&#x636E;&#x4E0A;&#x56FE;&#x6240;&#x793A;&#xFF0C;&#x5C06;&#x672C;&#x5730;&#x4EE3;&#x7801;&#x63D0;&#x4EA4;&#x5230;&#x963F;&#x91CC;&#x4E91;Git&#x88F8;&#x5E93;&#xFF08;&#x4FDD;&#x8BC1;&#x901F;&#x5EA6;&#xFF09;&#xFF0C;&#x7136;&#x540E;&#x89E6;&#x53D1; git &#x94A9;&#x5B50;&#xFF0C;&#x5C06;&#x88F8;&#x5E93;&#x4E2D;&#x7684;&#x4EE3;&#x7801; <code>git
pull</code> &#x5230;&#x963F;&#x91CC;&#x4E91;&#x672C;&#x5730;&#xFF0C;&#x518D;&#x5C06;&#x4EE3;&#x7801;&#x63D0;&#x4EA4;&#x5230;&#x7801;&#x4E91;&#x3001;Github&#x3001;VPS&#xFF0C;&#x505A;&#x5230;&#x591A;&#x5904;&#x5907;&#x4EFD;&#xFF0C;&#x6700;&#x540E;&#x89E6;&#x53D1; VPS &#x4E0A;&#x7684; git &#x94A9;&#x5B50;&#xFF0C;
&#x6267;&#x884C;&#x5BF9;&#x5E94;&#x7684;&#x811A;&#x672C;&#xFF0C;&#x4F7F;&#x5F97; gitbook &#x80FD;&#x81EA;&#x52A8;&#x66F4;&#x65B0;&#x3002;&#x5728; VPS &#x4E0A;&#x5B89;&#x88C5; nginx&#xFF0C;&#x5E76;&#x505A;&#x865A;&#x62DF;&#x4E3B;&#x673A;&#xFF0C;&#x4F7F;&#x5176;&#x6307;&#x5411; Gitbook&#x3002;&#x6700;&#x540E;&#x518D;&#x505A;&#x4E00;&#x4E2A; A &#x8BB0;&#x5F55;&#xFF0C;&#x4F7F;&#x4E8C;&#x7EA7;&#x57DF;&#x540D;
&#x6307;&#x5411; VPS&#x3002;</p>
<blockquote>
<p>&#x8BF4;&#x8BF4;&#x8FD9;&#x4E2A;&#x65B9;&#x6848;&#x7684;&#x4F18;&#x7F3A;&#x70B9;&#xFF1A;</p>
</blockquote>
<ul>
<li><p>&#x4F18;&#x70B9;</p>
<ul>
<li>&#x901F;&#x5EA6;&#x5FEB;, &#x56FD;&#x5185;&#x963F;&#x91CC;&#x4E91;&#x8BBF;&#x95EE;&#x901F;&#x5EA6;&#x5FEB;</li>
<li>&#x5907;&#x4EFD;&#x591A;, &#x5373;&#x4F7F; github &#x4E0D;&#x80FD;&#x8BBF;&#x95EE;&#xFF0C;&#x8FD8;&#x6709;&#x7801;&#x4E91;</li>
<li>&#x57DF;&#x540D;&#x65E0;&#x9700;&#x5907;&#x6848;, &#x56FD;&#x5916; VPS &#x65E0;&#x9700;&#x5907;&#x6848;</li>
</ul>
</li>
<li><p>&#x7F3A;&#x70B9;</p>
<ul>
<li>&#x64CD;&#x4F5C;&#x7E41;&#x6742;&#xFF0C;&#x65B0;&#x542F;&#x4E00;&#x4E2A;&#x4ED3;&#x5E93;&#x9700;&#x8981;&#x591A;&#x5904;&#x8BBE;&#x7F6E;</li>
<li>&#x8017;&#x5DE8;&#x8D44;&#xFF0C;&#x4E24;&#x4E2A; VPS &#x82B1;&#x8D39;&#x9AD8;</li>
<li>&#x56FD;&#x5916; VPS&#xFF0C;&#x535A;&#x5BA2;&#x6216;&#x8005;&#x81EA;&#x5EFA;&#x7684;gitbook&#x8BBF;&#x95EE;&#x901F;&#x5EA6;&#x6162;&#xFF08;&#x6709;cloudflare&#x505A;CDN&#x901F;&#x5EA6;&#x597D;&#x50CF;&#x4E5F;&#x4E0D;&#x6162;&#xFF09;</li>
</ul>
</li>
</ul>
<p>&#x4F60;&#x6709;&#x66F4;&#x597D;&#x7684;&#x65B9;&#x6848;&#x5417;&#xFF1F;&#x8BF7;&#x8054;&#x7CFB; sontek@yeah.net&#x3002;&#x4E0D;&#x80DC;&#x611F;&#x6FC0;</p>
<h2 id="2-&#x524D;&#x671F;&#x51C6;&#x5907;&#x5DE5;&#x4F5C;">2. &#x524D;&#x671F;&#x51C6;&#x5907;&#x5DE5;&#x4F5C;</h2>
<ul>
<li><p>&#x963F;&#x91CC;&#x4E91;&#x914D;&#x7F6E; git  </p>
<p>  &#x4E3B;&#x8981;&#x662F;&#x914D;&#x7F6E; <code>user.name</code>  &#x548C; <code>user.email</code>&#x3002;&#x5177;&#x4F53;&#x53C2;&#x8003;<a href="https://git.javaliu.com/02_config/01_git_base_config.html" target="_blank">&#x8FD9;&#x91CC;</a></p>
</li>
<li><p>VPS &#x5B89;&#x88C5; gitbook&#x3002;&#x5B89;&#x88C5;&#x6559;&#x7A0B;&#x53C2;&#x8003;<a href="https://sundry.javaliu.com/sundry/gitbook-doc.html" target="_blank">&#x8FD9;&#x91CC;</a></p>
</li>
<li>&#x5404;&#x4E2A;&#x673A;&#x5668;&#x7684;&#x514D;&#x5BC6;&#x64CD;&#x4F5C;&#xFF0C;&#x672C;&#x5730;&#x5230;&#x963F;&#x91CC;&#x4E91;&#xFF0C;&#x963F;&#x91CC;&#x4E91;&#x5230; VPS&#xFF0C;Github&#xFF0C;&#x7801;&#x4E91;</li>
</ul>
<pre><code class="lang-shell">$ ssh-copy-id -i ~/.ssh/id_rsa.pub git@&#x963F;&#x91CC;&#x4E91;IP
</code></pre>
<h2 id="3-&#x5177;&#x4F53;&#x5B9E;&#x73B0;">3 &#x5177;&#x4F53;&#x5B9E;&#x73B0;</h2>
<h4 id="31-&#x9996;&#x5148;&#x5728;&#x963F;&#x91CC;&#x4E91;&#x548C;linode&#x5883;&#x5916;vps-&#x4EE5;&#x4E0B;&#x7B80;&#x79F0;vps-&#x5BF9;&#x5E94;&#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA;&#x5BF9;&#x5E94;&#x7684;&#x88F8;&#x5E93;">3.1 &#x9996;&#x5148;&#x5728;&#x963F;&#x91CC;&#x4E91;&#x548C;Linode(&#x5883;&#x5916;VPS, &#x4EE5;&#x4E0B;&#x7B80;&#x79F0;VPS) &#x5BF9;&#x5E94;&#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA;&#x5BF9;&#x5E94;&#x7684;&#x88F8;&#x5E93;</h4>
<ul>
<li>&#x4EE3;&#x7801;&#x5E93;  <code>/home/git/gitRepo/code</code></li>
<li>Gitbook&#x5E93; <code>/home/git/gitRepo/gitbook</code></li>
<li>&#x5176;&#x4ED6;    <code>/home/git/gitRepo/sundry</code></li>
</ul>
<p>&#x521B;&#x5EFA;&#x88F8;&#x5E93;</p>
<pre><code class="lang-shell">$ cd /home/git/gitRepo/gitbook/
$ git init --bare git-book.git
</code></pre>
<h4 id="32-&#x521B;&#x5EFA;&#x65B0;&#x7684;&#x9879;&#x76EE;&#x6216;&#x8005;&#x4ECE;-github-&#x4E0A;-clone-&#x5DF2;&#x5B58;&#x5728;&#x7684;&#x9879;&#x76EE;&#x672C;&#x5730;&#x673A;&#x5668;">3.2 &#x521B;&#x5EFA;&#x65B0;&#x7684;&#x9879;&#x76EE;&#x6216;&#x8005;&#x4ECE; Github &#x4E0A; clone &#x5DF2;&#x5B58;&#x5728;&#x7684;&#x9879;&#x76EE;(&#x672C;&#x5730;&#x673A;&#x5668;)</h4>
<pre><code class="lang-shell"># &#x5DF2;&#x5B58;&#x5728;&#x9879;&#x76EE;
git clone git@github.com:sontekliu/git-book.git

# &#x521B;&#x5EFA;&#x65B0;&#x9879;&#x76EE;
git init git-book
</code></pre>
<h4 id="33-&#x5C06;&#x9879;&#x76EE;&#x63D0;&#x4EA4;&#x5230;&#x963F;&#x91CC;&#x4E91;">3.3 &#x5C06;&#x9879;&#x76EE;&#x63D0;&#x4EA4;&#x5230;&#x963F;&#x91CC;&#x4E91;</h4>
<ul>
<li>&#x5DF2;&#x5B58;&#x5728;&#x9879;&#x76EE;</li>
</ul>
<pre><code class="lang-shell">$ git remote add aliyun git@&#x963F;&#x91CC;&#x4E91;IP:/home/git/gitRepo/gitbook/git-book.git
$ git push aliyun master:master
</code></pre>
<ul>
<li>&#x65B0;&#x9879;&#x76EE;</li>
</ul>
<pre><code class="lang-shell">$ git clone git@&#x963F;&#x91CC;&#x4E91;IP:/home/git/gitRepo/gitbook/go-book.git
</code></pre>
<h4 id="34-&#x5C06;-origin-&#x7684;&#x5730;&#x5740;&#x6539;&#x6210;&#x963F;&#x91CC;&#x4E91;&#x5730;&#x5740;-&#x5373;&#x672C;&#x5730;&#x53EA;&#x63D0;&#x4EA4;&#x5230;&#x963F;&#x91CC;&#x4E91;&#xFF0C;&#x63D0;&#x9AD8;&#x901F;&#x5EA6;&#x672C;&#x5730;&#x673A;&#x5668;">3.4 &#x5C06; origin &#x7684;&#x5730;&#x5740;&#x6539;&#x6210;&#x963F;&#x91CC;&#x4E91;&#x5730;&#x5740;, &#x5373;&#x672C;&#x5730;&#x53EA;&#x63D0;&#x4EA4;&#x5230;&#x963F;&#x91CC;&#x4E91;&#xFF0C;&#x63D0;&#x9AD8;&#x901F;&#x5EA6;(&#x672C;&#x5730;&#x673A;&#x5668;)</h4>
<p>&#x65B0;&#x9879;&#x76EE;&#x662F;&#x76F4;&#x63A5;&#x4ECE;&#x963F;&#x91CC;&#x4E91;clone&#x4E0B;&#x6765;&#x7684;&#xFF0C;origin &#x5730;&#x5740;&#x9ED8;&#x8BA4;&#x5C31;&#x662F;&#x963F;&#x91CC;&#x4E91;&#x5730;&#x5740;&#xFF0C;&#x65E0;&#x9700;&#x4FEE;&#x6539;&#x3002;</p>
<p>&#x9488;&#x5BF9;&#x5DF2;&#x5B58;&#x5728;&#x7684;&#x9879;&#x76EE;&#xFF0C;&#x7F16;&#x8F91;&#x672C;&#x9879;&#x76EE;&#x4E0B;&#x7684; <code>.git/config</code> &#x6587;&#x4EF6;&#xFF0C;&#x4FEE;&#x6539;&#x5982;&#x4E0B;&#xFF1A;</p>
<p>&#x613F;&#x5185;&#x5BB9;&#xFF08;&#x6CE8;&#x610F;&#x5DF2;&#x505A;&#x5220;&#x51CF;&#xFF09;&#xFF1A;</p>
<pre><code>[remote &quot;origin&quot;]
    url = git@github.com:sontekliu/git-book.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[remote &quot;aliyun&quot;]
    url = git@39.105.28.88:/home/git/gitRepo/gitbook/git-book.git
    fetch = +refs/heads/*:refs/remotes/aliyun/*
</code></pre><p>&#x4FEE;&#x6539;&#x6210;&#x5982;&#x4E0B;&#x5185;&#x5BB9;&#xFF1A;</p>
<pre><code>[remote &quot;origin&quot;]
    url = git@39.105.28.88:/home/git/gitRepo/gitbook/git-book.git
    fetch = +refs/heads/*:refs/remotes/origin/*
</code></pre><p>&#x53BB;&#x6389;&#x4E86;&#x521A;&#x521A;&#x6DFB;&#x52A0;&#x7684; <code>aliyun</code> &#xFF0C;&#x5E76;&#x5C06;&#x539F;&#x6765; <code>Github</code> &#x7684;&#x5730;&#x5740;&#x66F4;&#x6362;&#x6210;&#x4E86;&#x963F;&#x91CC;&#x4E91;&#x5730;&#x5740;</p>
<h4 id="35-&#x5C06;&#x9879;&#x76EE;&#x5907;&#x4EFD;&#x591A;&#x4EFD;&#x963F;&#x91CC;&#x4E91;">3.5 &#x5C06;&#x9879;&#x76EE;&#x5907;&#x4EFD;&#x591A;&#x4EFD;(&#x963F;&#x91CC;&#x4E91;)</h4>
<p>&#x5F53;&#x63D0;&#x4EA4;&#x4EE3;&#x7801;&#x5230;&#x963F;&#x91CC;&#x4E91;&#x65F6;&#xFF0C;&#x89E6;&#x53D1; git &#x7684;&#x52FE;&#x5B50;&#xFF0C;&#x5C06;&#x4EE3;&#x7801;&#x518D;&#x6B21;&#x63D0;&#x4EA4;&#x5230; Github&#x548C;&#x7801;&#x4E91;</p>
<ul>
<li><p>&#x9996;&#x5148;&#x5728;&#x5BF9;&#x5E94;&#x5E73;&#x53F0;(&#x7801;&#x4E91;&#x548C;Github)&#x521B;&#x5EFA;&#x76F8;&#x5E94;&#x7684;&#x4ED3;&#x5E93;</p>
</li>
<li><p>&#x5C06;&#x63D0;&#x4EA4;&#x5230;&#x963F;&#x91CC;&#x4E91;&#x88F8;&#x5E93;&#x7684;&#x9879;&#x76EE; clone &#x5230;&#x963F;&#x91CC;&#x4E91;&#x672C;&#x5730;</p>
<ul>
<li>&#x4EE3;&#x7801;&#x5E93;  <code>/home/git/gitspace/code</code></li>
<li>Gitbook&#x5E93; <code>/home/git/gitspace/gitbook</code></li>
<li><p>&#x5176;&#x4ED6;    <code>/home/git/gitspace/sundry</code></p>
<pre><code class="lang-shell">$ cd /home/git/gitspace/gitbook
$ git clone /home/git/gitRepo/gitbook/git-book.git
</code></pre>
</li>
</ul>
</li>
<li><p>&#x4FEE;&#x6539;&#x9879;&#x76EE;(&#x5728;&#x963F;&#x91CC;&#x4E91;)&#x5730;&#x5740;&#xFF0C;&#x4F7F;&#x5176;&#x6307;&#x5411;&#x591A;&#x4E2A;&#x5730;&#x5740;</p>
</li>
</ul>
<p>&#x4FEE;&#x6539; <code>clone</code> &#x5230;&#x963F;&#x91CC;&#x4E91;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x7684;&#x6587;&#x4EF6;&#xFF0C;<code>/home/git/gitspace/gitbook/git-book/.git/config</code></p>
<p>&#x613F;&#x5185;&#x5BB9;&#x4E3A;:</p>
<pre><code>[remote &quot;origin&quot;]
        url = /home/git/gitRepo/gitbook/git-book.git
        fetch = +refs/heads/*:refs/remotes/origin/*
</code></pre><p>&#x4FEE;&#x6539;&#x4E3A;:</p>
<pre><code>[remote &quot;origin&quot;]
        url = /home/git/gitRepo/gitbook/git-book.git
        url = git@github.com:sontekliu/git-book.git 
        url = git@gitee.com:sontekliu/git-book.git
        url = git@VPS_IP:/home/git/gitRepo/gitbook/git-book.git
        fetch = +refs/heads/*:refs/remotes/origin/*
</code></pre><p>&#x6B64;&#x5904;&#x989D;&#x5916;&#x6DFB;&#x52A0;&#x4E86;&#x4E09;&#x4E2A;&#x5730;&#x5740;&#xFF0C;&#x5206;&#x522B;&#x662F; <code>Github</code>&#xFF0C;<code>&#x7801;&#x4E91;</code>&#xFF0C;&#x4E2A;&#x4EBA;VPS, &#x6B64;&#x5904;&#x6CE8;&#x610F;&#x4E00;&#x5B9A;&#x8981;&#x5C06;&#x963F;&#x91CC;&#x4E91; <code>git</code> &#x7528;&#x6237;&#x7684;&#x516C;&#x94A5;&#x90FD;&#x6DFB;&#x52A0;
&#x5230;&#x5BF9;&#x5E94;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x4EE5;&#x4FBF;&#x5728;&#x4EE3;&#x7801;&#x63D0;&#x4EA4;&#x7684;&#x65F6;&#x5019;&#x80FD;&#x591F;&#x514D;&#x5BC6;</p>
<ul>
<li>&#x7F16;&#x5199; Git &#x52FE;&#x5B50;&#x811A;&#x672C;&#x4F7F;&#x5176;&#x81EA;&#x52A8;&#x5316;</li>
</ul>
<p>&#x5728;&#x963F;&#x91CC;&#x4E91;&#x7684;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x4E2D;&#x7F16;&#x5199;&#x811A;&#x672C;&#xFF0C;&#x4F7F;&#x5176;&#x81EA;&#x52A8;&#x5316;&#x63D0;&#x4EA4;&#x3002;</p>
<pre><code class="lang-shell">$ cd /home/git/gitRepo/gitbook/git-book.git/hooks/
$ cp post-update.sample post-update
$ vim post-update
</code></pre>
<p><code>post-update</code> &#x5185;&#x5BB9;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to &quot;post-update&quot;.

# exec git update-server-info
unset GIT_DIR
GIT_DIR=/home/git/gitspace/gitbook/git-book
cd $GIT_DIR
echo `pwd`
# &#x62C9;&#x53D6;&#x4EE3;&#x7801;&#x5230;&#x963F;&#x91CC;&#x4E91;&#x672C;&#x5730;
git pull origin master 
# &#x63D0;&#x4EA4;&#x5230;&#x8FDC;&#x7A0B;
git push origin &gt;&amp;- 2&gt;&amp;- &amp;
# git push origin &gt;/dev/null 2&gt;&amp;1 &amp;
</code></pre><h2 id="4-vps-&#x914D;&#x7F6E;">4. VPS &#x914D;&#x7F6E;</h2>
<blockquote>
<p>&#x5982;&#x679C;&#x6CA1;&#x6709;&#x57DF;&#x540D;&#x6216;&#x8005;&#x6CA1;&#x6709; gitbook&#xFF0C;&#x53EF;&#x4EE5;&#x4E0D;&#x770B;&#x6B64;&#x7AE0;&#x8282;&#x3002;</p>
</blockquote>
<h4 id="41-&#x7F16;&#x5199;-git-&#x94A9;&#x5B50;&#x811A;&#x672C;&#xFF0C;&#x4F7F;&#x5176;&#x81EA;&#x52A8;&#x66F4;&#x65B0;-gitbook">4.1 &#x7F16;&#x5199; git &#x94A9;&#x5B50;&#x811A;&#x672C;&#xFF0C;&#x4F7F;&#x5176;&#x81EA;&#x52A8;&#x66F4;&#x65B0; gitbook</h4>
<p>&#x5728; VPS &#x7684;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#x4E2D;&#x7F16;&#x5199;&#x811A;&#x672C;&#xFF0C;&#x4F7F;&#x5176;&#x81EA;&#x52A8;&#x66F4;&#x65B0; gitbook &#x5185;&#x5BB9;&#x3002;</p>
<pre><code class="lang-shell">$ cd /home/git/gitRepo/gitbook/git-book.git/hooks/
$ cp post-update.sample post-update
$ vim post-update
</code></pre>
<p><code>post-update</code> &#x5185;&#x5BB9;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to &quot;post-update&quot;.

# exec git update-server-info
unset GIT_DIR
GIT_DIR=/home/git/gitspace/gitbook/git-book
cd $GIT_DIR
# &#x66F4;&#x65B0;&#x4ED3;&#x5E93;
git pull origin master
# &#x7F16;&#x8BD1;&#x66F4;&#x65B0; gitbook
gitbook build &gt;&gt;/dev/null
</code></pre><h4 id="42-&#x914D;&#x7F6E;&#x865A;&#x62DF;&#x4E3B;&#x673A;">4.2 &#x914D;&#x7F6E;&#x865A;&#x62DF;&#x4E3B;&#x673A;</h4>
<p>&#x9996;&#x5148;&#xFF0C;&#x786E;&#x4FDD; VPS &#x4E0A;&#x5DF2;&#x5B89;&#x88C5; Nginx&#xFF0C;&#x53EF;&#x53C2;&#x8003;<a href="https://sundry.javaliu.com/nginx/nginx-install.html" target="_blank">&#x8FD9;&#x91CC;</a>&#x5B89;&#x88C5;&#x3002;</p>
<pre><code class="lang-shell"># root &#x7528;&#x6237;&#x64CD;&#x4F5C;

# cd /etc/nginx
# mkdir sites-available sites-enabled

# &#x7F16;&#x8F91; nginx.conf, &#x6700;&#x4E0B;&#x9762;&#x6DFB;&#x52A0;&#x5982;&#x4E0B;&#x5185;&#x5BB9;
# vim /etc/nginx/nginx.conf
--------------------------
http{
    // .... &#x7701;&#x7565;&#x5185;&#x5BB9;

    include sites-enabled/*;
}
</code></pre>
<ul>
<li>&#x521B;&#x5EFA;&#x5BF9;&#x5E94; gitbook &#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</li>
</ul>
<pre><code class="lang-shell"># cd /etc/nginx/sites-available
# vim git.conf
------------------------------
# &#x5185;&#x5BB9;&#x5982;&#x4E0B;&#xFF1A;

server {
    listen 80;
    charset utf-8;
    access_log logs/git.access.log main;
    server_name git.javaliu.com;

    location / {
        root /home/git/gitspace/gitbook/git-book/_book;
        index index.html index.htm;
    }
}
</code></pre>
<p>&#x5982;&#x679C;&#x4F60;&#x7684;&#x7F51;&#x7AD9;&#x5F00;&#x542F;&#x4E86; <code>https</code> , &#x914D;&#x7F6E;&#x5185;&#x5BB9;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code># vim git.conf
--------------------------
server {
        charset utf-8;
        access_log logs/git.access.log main;
        server_name git.javaliu.com;

        location / {
                root /home/git/gitspace/gitbook/git-book/_book;
                index index.html index.htm;
        }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/javaliu.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/javaliu.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}
server {
    if ($host = git.javaliu.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    server_name git.javaliu.com;
    return 301 https://$server_name$request_uri;
}
</code></pre><ul>
<li>&#x542F;&#x7528;&#x914D;&#x7F6E;, &#x5728; sites-enabled &#x521B;&#x5EFA;&#x5BF9;&#x5E94;&#x7684;&#x8F6F;&#x8FDE;&#x63A5;</li>
</ul>
<pre><code class="lang-shell"># cd /etc/nginx/sites-enabled
# ln -s /etc/nginx/sites-available/git.conf  git.conf
# nginx -s reload       # &#x91CD;&#x65B0;&#x52A0;&#x8F7D; nginx &#x914D;&#x7F6E;&#x6587;&#x4EF6;
</code></pre>
<h2 id="5-&#x7ED3;&#x675F;">5. &#x7ED3;&#x675F;</h2>
<p>&#x5927;&#x529F;&#x544A;&#x6210;!!!</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="gitbook-to-github.html" class="navigation navigation-prev " aria-label="Previous page: gitbook 集成到Github">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="markdown-doc.html" class="navigation navigation-next " aria-label="Next page: markdown 语法">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Git提速","level":"1.3.4","depth":2,"next":{"title":"markdown 语法","level":"1.3.5","depth":2,"path":"sundry/markdown-doc.md","ref":"sundry/markdown-doc.md","articles":[]},"previous":{"title":"gitbook 集成到Github","level":"1.3.3","depth":2,"path":"sundry/gitbook-to-github.md","ref":"sundry/gitbook-to-github.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["toggle-chapters"],"pluginsConfig":{"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"sundry/git-integrate.md","mtime":"2019-10-10T02:57:37.492Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-12-17T05:25:43.709Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

